package com.ruoyi.yanjing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yanjing.mapper.MedicalReportsMapper;
import com.ruoyi.yanjing.domain.MedicalReports;
import com.ruoyi.yanjing.service.IMedicalReportsService;

/**
 * 人员体检信息Service业务层处理
 * 
 * @author whz
 * @date 2024-12-04
 */
@Service
public class MedicalReportsServiceImpl implements IMedicalReportsService 
{
    @Autowired
    private MedicalReportsMapper medicalReportsMapper;

    /**
     * 查询人员体检信息
     * 
     * @param id 人员体检信息主键
     * @return 人员体检信息
     */
    @Override
    public MedicalReports selectMedicalReportsById(Long id)
    {
        return medicalReportsMapper.selectMedicalReportsById(id);
    }

    /**
     * 查询人员体检信息列表
     * 
     * @param medicalReports 人员体检信息
     * @return 人员体检信息
     */
    @Override
    public List<MedicalReports> selectMedicalReportsList(MedicalReports medicalReports)
    {
        return medicalReportsMapper.selectMedicalReportsList(medicalReports);
    }

    /**
     * 新增人员体检信息
     * 
     * @param medicalReports 人员体检信息
     * @return 结果
     */
    @Override
    public int insertMedicalReports(MedicalReports medicalReports)
    {
        medicalReports.setCreateTime(DateUtils.getNowDate());
        return medicalReportsMapper.insertMedicalReports(medicalReports);
    }

    /**
     * 修改人员体检信息
     * 
     * @param medicalReports 人员体检信息
     * @return 结果
     */
    @Override
    public int updateMedicalReports(MedicalReports medicalReports)
    {
        medicalReports.setUpdateTime(DateUtils.getNowDate());
        return medicalReportsMapper.updateMedicalReports(medicalReports);
    }

    /**
     * 批量删除人员体检信息
     * 
     * @param ids 需要删除的人员体检信息主键
     * @return 结果
     */
    @Override
    public int deleteMedicalReportsByIds(Long[] ids)
    {
        return medicalReportsMapper.deleteMedicalReportsByIds(ids);
    }

    /**
     * 删除人员体检信息信息
     * 
     * @param id 人员体检信息主键
     * @return 结果
     */
    @Override
    public int deleteMedicalReportsById(Long id)
    {
        return medicalReportsMapper.deleteMedicalReportsById(id);
    }
}
